// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

//------------------------------------------------------------------------------
// <auto-generated>
//     Types declaration for SharpDX.X3DAudio namespace.
//     This code was generated by a tool.
//     Date : 30/06/2015 16:02:47
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#if !WINDOWS_UWP
using System;
using System.Runtime.InteropServices;
using System.Security;
namespace SharpDX.X3DAudio {

#pragma warning disable 419
#pragma warning disable 1587
#pragma warning disable 1574

        /// <summary>	
        /// Functions	
        /// </summary>	
        /// <include file='Documentation\CodeComments.xml' path="/comments/comment[@id='SharpDX.X3DAudio.X3DAudio']/*"/>	
    internal class X3DAudio17 {   
        
        /// <summary>	
        /// <p>Calculates DSP settings with respect to 3D parameters.</p>	
        /// </summary>	
        /// <param name="instance"><dd> <p>3D audio instance handle. Call <strong><see cref="SharpDX.X3DAudio.X3DAudio.X3DAudioInitialize"/></strong> to get this handle.</p> </dd></param>	
        /// <param name="listenerRef"><dd> <p>Pointer to an <strong><see cref="SharpDX.X3DAudio.Listener"/></strong> representing the point of reception.</p> </dd></param>	
        /// <param name="emitterRef"><dd> <p>Pointer to an <strong><see cref="SharpDX.X3DAudio.Emitter"/></strong> representing the sound source.</p> </dd></param>	
        /// <param name="flags"><dd> <table> <tr><th>Value</th><th>Description</th></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.Matrix"/></td><td>Enables matrix coefficient table calculation.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.Delay"/></td><td>Enables delay time array calculation (stereo only).?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.LpfDirect"/></td><td>Enables low pass filter (LPF) direct-path coefficient calculation.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.LpfReverb"/></td><td>Enables LPF reverb-path coefficient calculation.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.Reverb"/></td><td>Enables reverb send level calculation.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.Doppler"/></td><td>Enables Doppler shift factor calculation.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.EmitterAngle"/></td><td>Enables emitter-to-listener interior angle calculation.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.ZeroCenter"/></td><td>Fills the center channel with silence. This flag allows you to keep a 6-channel matrix so you do not have to remap the channels,  but the center channel will be silent.  This flag is only valid if you also set <see cref="SharpDX.X3DAudio.CalculateFlags.Matrix"/>.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.RedirectToLfe"/></td><td> Applies an equal mix of all source channels to a low frequency effect (LFE) destination channel. It only applies to matrix calculations with a source that does not have an LFE channel and a destination that does have an LFE channel.  This flag is only valid  if you also set <see cref="SharpDX.X3DAudio.CalculateFlags.Matrix"/>.?</td></tr> </table> <p>?</p> </dd></param>	
        /// <param name="dSPSettingsRef"><dd> <p>Pointer to an <strong><see cref="SharpDX.X3DAudio.DspSettings"/></strong> structure that receives the calculation results.</p> </dd></param>	
        /// <remarks>	
        /// <p>You typically call <strong><see cref="SharpDX.X3DAudio.X3DAudio.X3DAudioCalculate"/></strong> once for each pair of emitting objects and listeners in the scene. After each call, to apply the 3D effects, the app manually applies the calculation results at <em>pDSPSettings</em> to the XAUDIO2 graph. For more info, see How to: Integrate X3DAudio with XAudio2.</p><p><strong>Important</strong>?? The listener and emitter values must be valid. Floating-point specials (NaN, QNaN, +INF, -INF) can cause the entire audio output to go silent if introduced into a running audio graph.</p>	
        /// </remarks>	
        /// <include file='Documentation\CodeComments.xml' path="/comments/comment[@id='X3DAudioCalculate']/*"/>	
        /// <msdn-id>microsoft.directx_sdk.x3daudio.x3daudiocalculate</msdn-id>	
        /// <unmanaged>void X3DAudioCalculate([In] const X3DAUDIOHANDLE* Instance,[In] const X3DAUDIO_LISTENER* pListener,[In] const X3DAUDIO_EMITTER* pEmitter,[In] X3DAudioCalculateFlags Flags,[In] void* pDSPSettings)</unmanaged>	
        /// <unmanaged-short>X3DAudioCalculate</unmanaged-short>	
        public static void X3DAudioCalculate(ref SharpDX.X3DAudio.X3DAudioHandle instance, SharpDX.X3DAudio.Listener listenerRef, SharpDX.X3DAudio.Emitter emitterRef, SharpDX.X3DAudio.CalculateFlags flags, System.IntPtr dSPSettingsRef) {
            unsafe {
                var listenerRef_ = new SharpDX.X3DAudio.Listener.__Native();
                listenerRef.__MarshalTo(ref listenerRef_);
                var emitterRef_ = new SharpDX.X3DAudio.Emitter.__Native();
                emitterRef.__MarshalTo(ref emitterRef_);
                fixed (void* instance_ = &instance)
                    X3DAudioCalculate_(instance_, &listenerRef_, &emitterRef_, unchecked((int)flags), (void*)dSPSettingsRef);		
                listenerRef.__MarshalFree(ref listenerRef_);
                emitterRef.__MarshalFree(ref emitterRef_);
            }
        }
        [DllImport("X3DAudio1_7.dll", EntryPoint = "X3DAudioCalculate", CallingConvention = CallingConvention.Cdecl)]
        private unsafe static extern void X3DAudioCalculate_(void* arg0,void* arg1,void* arg2,int arg3,void* arg4);
        
        /// <summary>	
        /// <p>Sets all global 3D audio constants.</p>	
        /// </summary>	
        /// <param name="speakerChannelMask"><dd> <p>Assignment of channels to speaker positions. This value must not be zero. The only permissible value on Xbox 360 is SPEAKER_XBOX.</p> </dd></param>	
        /// <param name="speedOfSound"><dd> <p>Speed of sound, in user-defined world units per second. Use this value only for doppler calculations. It must be greater than or equal to FLT_MIN.</p> </dd></param>	
        /// <param name="instance"><dd> <p>3D audio instance handle. Use this handle when you call <strong><see cref="SharpDX.X3DAudio.X3DAudio.X3DAudioCalculate"/></strong>.</p> </dd></param>	
        /// <returns><p>This function does not return a value.</p></returns>	
        /// <remarks>	
        /// <p><strong>X3DAUDIO_HANDLE</strong> is an opaque data structure. Because the operating system doesn't allocate any additional storage for the 3D audio instance handle, you don't need to free or close it.</p>	
        /// </remarks>	
        /// <include file='Documentation\CodeComments.xml' path="/comments/comment[@id='X3DAudioInitialize']/*"/>	
        /// <msdn-id>microsoft.directx_sdk.x3daudio.x3daudioinitialize</msdn-id>	
        /// <unmanaged>HRESULT X3DAudioInitialize([In] SPEAKER_FLAGS SpeakerChannelMask,[In] float SpeedOfSound,[Out] X3DAUDIOHANDLE* Instance)</unmanaged>	
        /// <unmanaged-short>X3DAudioInitialize</unmanaged-short>	
        public static void X3DAudioInitialize(SharpDX.Multimedia.Speakers speakerChannelMask, float speedOfSound, out SharpDX.X3DAudio.X3DAudioHandle instance) {
            unsafe {
                instance = new SharpDX.X3DAudio.X3DAudioHandle();
                SharpDX.Result __result__;
                fixed (void* instance_ = &instance)
                    __result__= 
    				X3DAudioInitialize_(unchecked((int)speakerChannelMask), speedOfSound, instance_);		
                __result__.CheckError();
            }
        }
        [DllImport("X3DAudio1_7.dll", EntryPoint = "X3DAudioInitialize", CallingConvention = CallingConvention.Cdecl)]
        private unsafe static extern int X3DAudioInitialize_(int arg0,float arg1,void* arg2);
    }
}
#endif